﻿<ResourceDictionary
	xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" 
	xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
	xmlns:Microsoft_Windows_Themes="clr-namespace:Microsoft.Windows.Themes;assembly=PresentationFramework.Aero">
	
	<Style x:Key="MenuLabelStyle" TargetType="{x:Type Label}">
		<Setter Property="FontWeight" Value="Bold"/>
		<Setter Property="FontFamily" Value="SketchFlow Print"/>
		<Setter Property="FontSize" Value="24"/>
		<Setter Property="FontStyle" Value="Normal"/>
		<Setter Property="Effect">
			<Setter.Value>
				<DropShadowEffect BlurRadius="0" ShadowDepth="3"/>
			</Setter.Value>
		</Setter>
		<Setter Property="Foreground" Value="{StaticResource borderBrush}"/>
	</Style>
	
	<Style x:Key="IconButtonStyle"
               TargetType="{x:Type Button}">
		<Style.Triggers>
			<Trigger Property="IsCancel" Value="False"/>
		</Style.Triggers>
            <!-- set some default values -->
            <Setter Property="Background"
                    Value="Transparent" />
            <Setter Property="BorderBrush"
                    Value="Transparent" />
            <!-- set the visual tree of the control -->
            <Setter Property="Template">
                <Setter.Value>
                    <ControlTemplate TargetType="{x:Type Button}">
                        <!-- here come the actual sub-controls -->
                        <Border x:Name="border"
                                Height="{TemplateBinding Height}"
                                Width="{TemplateBinding Width}"
                                SnapsToDevicePixels="True"
                                Background="{TemplateBinding Background}"
                                BorderBrush="{TemplateBinding BorderBrush}"
                                BorderThickness="1"
                                Padding="0"
                                CornerRadius="3,3,3,3">
                            <Border x:Name="innerBorder"
                                    SnapsToDevicePixels="True"
                                    BorderThickness="1"
                                    Padding="2"
                                    CornerRadius="3,3,3,3">
                                <ContentPresenter SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}"
                                                  HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
                                                  VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
                                                  RecognizesAccessKey="True"
                                                  Margin="{TemplateBinding Padding}">
                                    <ContentPresenter.Effect>
                                        <!-- give the content a bit of shadow -->
                                        <DropShadowEffect x:Name="shadow"
                                                          ShadowDepth="2"
                                                          Opacity="0.7"
                                                          BlurRadius="3" />
                                    </ContentPresenter.Effect>
                                    <ContentPresenter.RenderTransform>
                                        <!-- push the content a bit to the left and the top -->
                                        <TranslateTransform x:Name="translation"
                                                            X="-1"
                                                            Y="-1" />
                                    </ContentPresenter.RenderTransform>
                                </ContentPresenter>
                            </Border>
                        </Border>
                        <ControlTemplate.Triggers>
                            <!-- 
                                the triggers define the reactions to various state
                                changes
                            -->
                            <Trigger Property="IsKeyboardFocused"
                                     Value="true">
                                <Setter TargetName="innerBorder"
                                        Property="BorderBrush"
                                        Value="#ff06cdff" />
                                <Setter Property="Background"
                                        Value="LightBlue" />
                            </Trigger>
                            <Trigger Property="IsMouseOver"
                                     Value="true">
                                <Setter Property="Background"
                                        Value="LightYellow" />
                            </Trigger>
                            <!-- when the control is disabled, just let the background shine through -->
                            <Trigger Property="IsEnabled"
                                     Value="false">
                                <Setter Property="Opacity"
                                        Value="0.5" />
                            </Trigger>
                            <Trigger Property="IsPressed"
                                     Value="True">
                                <!-- This Trigger manages the Animation of the button's content and its shadow -->
                                <Trigger.EnterActions>
                                    <BeginStoryboard>
                                        <Storyboard>
                                            <DoubleAnimation Duration="0:0:0"
                                                             To="0"
                                                             Storyboard.TargetName="shadow"
                                                             Storyboard.TargetProperty="(DropShadowEffect.ShadowDepth)" />
                                            <DoubleAnimation Duration="0:0:0"
                                                             To="0"
                                                             Storyboard.TargetName="translation"
                                                             Storyboard.TargetProperty="(TranslateTransform.X)" />
                                            <DoubleAnimation Duration="0:0:0"
                                                             To="0"
                                                             Storyboard.TargetName="translation"
                                                             Storyboard.TargetProperty="(TranslateTransform.Y)" />
                                        </Storyboard>
                                    </BeginStoryboard>
                                </Trigger.EnterActions>
                                <Trigger.ExitActions>
                                    <BeginStoryboard>
                                        <Storyboard>
                                            <DoubleAnimation Duration="0:0:0"
                                                             To="1"
                                                             Storyboard.TargetName="shadow"
                                                             Storyboard.TargetProperty="(DropShadowEffect.ShadowDepth)" />
                                            <DoubleAnimation Duration="0:0:0"
                                                             To="-1"
                                                             Storyboard.TargetName="translation"
                                                             Storyboard.TargetProperty="(TranslateTransform.X)" />
                                            <DoubleAnimation Duration="0:0:0"
                                                             To="-1"
                                                             Storyboard.TargetName="translation"
                                                             Storyboard.TargetProperty="(TranslateTransform.Y)" />
                                        </Storyboard>
                                    </BeginStoryboard>
                                </Trigger.ExitActions>
                            </Trigger>
                        </ControlTemplate.Triggers>
                    </ControlTemplate>
                </Setter.Value>
            </Setter>
        </Style>

        <!-- This is what Expression Blend creates as default Template -->
        <Style x:Key="ButtonFocusVisual">
            <Setter Property="Control.Template">
                <Setter.Value>
                    <ControlTemplate>
                        <Rectangle SnapsToDevicePixels="true"
                                   Margin="2"
                                   Stroke="Black"
                                   StrokeDashArray="1 2"
                                   StrokeThickness="1" />
                    </ControlTemplate>
                </Setter.Value>
            </Setter>
        </Style>
		
        <LinearGradientBrush x:Key="ButtonNormalBackground"
                             EndPoint="0,1"
                             StartPoint="0,0">
            <GradientStop Color="#F3F3F3"
                          Offset="0" />
            <GradientStop Color="#EBEBEB"
                          Offset="0.5" />
            <GradientStop Color="#DDDDDD"
                          Offset="0.5" />
            <GradientStop Color="#CDCDCD"
                          Offset="1" />
        </LinearGradientBrush>
        <SolidColorBrush x:Key="ButtonNormalBorder"
                         Color="#FF707070" />
        <Style x:Key="DefaultButtonStyle"
               TargetType="{x:Type Button}">
            <Setter Property="FocusVisualStyle"
                    Value="{StaticResource ButtonFocusVisual}" />
            <Setter Property="Background"
                    Value="{StaticResource ButtonNormalBackground}" />
            <Setter Property="BorderBrush"
                    Value="{StaticResource ButtonNormalBorder}" />
            <Setter Property="BorderThickness"
                    Value="1" />
            <Setter Property="Foreground"
                    Value="{DynamicResource {x:Static SystemColors.ControlTextBrushKey}}" />
            <Setter Property="HorizontalContentAlignment"
                    Value="Center" />
            <Setter Property="VerticalContentAlignment"
                    Value="Center" />
            <Setter Property="Padding"
                    Value="1" />
            <Setter Property="Template">
                <Setter.Value>
                    <ControlTemplate TargetType="{x:Type Button}">
                        <Microsoft_Windows_Themes:ButtonChrome SnapsToDevicePixels="true"
                                                               x:Name="Chrome"
                                                               Background="{TemplateBinding Background}"
                                                               BorderBrush="{TemplateBinding BorderBrush}"
                                                               RenderDefaulted="{TemplateBinding IsDefaulted}"
                                                               RenderMouseOver="{TemplateBinding IsMouseOver}"
                                                               RenderPressed="{TemplateBinding IsPressed}">
                            <ContentPresenter SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}"
                                              HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
                                              Margin="{TemplateBinding Padding}"
                                              VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
                                              RecognizesAccessKey="True" />
                        </Microsoft_Windows_Themes:ButtonChrome>
                        <ControlTemplate.Triggers>
                            <Trigger Property="IsKeyboardFocused"
                                     Value="true">
                                <Setter Property="RenderDefaulted"
                                        TargetName="Chrome"
                                        Value="true" />
                            </Trigger>
                            <Trigger Property="ToggleButton.IsChecked"
                                     Value="true">
                                <Setter Property="RenderPressed"
                                        TargetName="Chrome"
                                        Value="true" />
                            </Trigger>
                            <Trigger Property="IsEnabled"
                                     Value="false">
                                <Setter Property="Foreground"
                                        Value="#ADADAD" />
                            </Trigger>
                        </ControlTemplate.Triggers>
                    </ControlTemplate>
                </Setter.Value>
            </Setter>
        </Style>
	
	<Style x:Key="ItemBorderStyle" TargetType="{x:Type Border}">
		<Setter Property="BorderBrush" Value="{StaticResource itemBorderBrush}"/>
		<Setter Property="BorderThickness" Value="2"/>
		<Setter Property="CornerRadius" Value="3"/>
		<Setter Property="Background" Value="{StaticResource borderBrush}"/>
		<Setter Property="Margin" Value="0, 2"/>
	</Style>
	
	<Style x:Key="GeneralListBoxStyle" TargetType="{x:Type ListBox}">
		<Style.Triggers>
			<Trigger Property="HasItems" Value="False">
				<Setter Property="Background">
					<Setter.Value>
						<ImageBrush ImageSource="/MovieRental.Presentation;component/Images/noItems.png" Stretch="Uniform"/>
					</Setter.Value>
				</Setter>
			</Trigger>
		</Style.Triggers>
		<Setter Property="ScrollViewer.HorizontalScrollBarVisibility" Value="Disabled"/>
		<Setter Property="Background" Value="{x:Null}"/>
		<Setter Property="BorderThickness" Value="0"/>
	</Style>
	
	<Style x:Key="CartsListStyle" BasedOn="{StaticResource GeneralListBoxStyle}" TargetType="{x:Type ListBox}">
		<Style.Triggers>
			<Trigger Property="HasItems" Value="False">
				<Setter Property="Background">
					<Setter.Value>
						<ImageBrush ImageSource="/MovieRental.Presentation;component/Images/movieIcon.png" Stretch="None" Opacity="0.5"/>
					</Setter.Value>
				</Setter>
			</Trigger>
		</Style.Triggers>
	</Style>
	
	<Style x:Key="OnSaleListStyle" BasedOn="{StaticResource GeneralListBoxStyle}" TargetType="{x:Type ListBox}">
		<Style.Triggers>
			<Trigger Property="HasItems" Value="False">
				<Setter Property="Background">
					<Setter.Value>
						<ImageBrush ImageSource="/MovieRental.Presentation;component/Images/nothingOnSale.png" Stretch="Uniform" Opacity="0.5"/>
					</Setter.Value>
				</Setter>
			</Trigger>
		</Style.Triggers>
	</Style>
	
	<Style x:Key="CartStyle" BasedOn="{StaticResource GeneralListBoxStyle}" TargetType="{x:Type ListBox}">
		<Style.Triggers>
			<Trigger Property="HasItems" Value="False">
				<Setter Property="Background">
					<Setter.Value>
						<ImageBrush Stretch="Uniform" Opacity="0.5" ImageSource="/MovieRental.Presentation;component/Images/emptyCart.png"/>
					</Setter.Value>
				</Setter>
			</Trigger>
		</Style.Triggers>
	</Style>
	
	<Style x:Key="HugeInputTextBoxStyle" TargetType="{x:Type TextBox}">
		<Setter Property="Background" Value="{StaticResource itemBackgroundBrush}"/>
		<Setter Property="Foreground" Value="{StaticResource inputBoxBrush}"/>
		<Setter Property="BorderBrush" Value="{StaticResource borderBrush}"/>
		<Setter Property="BorderThickness" Value="2"/>
		<Setter Property="FontSize" Value="{StaticResource dialogElementFontSize}"/>
		<Style.Triggers>
			<Trigger Property="Validation.HasError" Value="True">
				<Setter Property="BorderBrush" Value="Red"/>
				<Setter Property="ToolTip" Value="{Binding RelativeSource={RelativeSource Self}, Path=(Validation.Errors)[0].ErrorContent}" />
			</Trigger>
		</Style.Triggers>
	</Style>
	<!-- Resource dictionary entries should be defined here. -->
	
	<Style x:Key="InputTextBoxStyle" TargetType="{x:Type TextBox}" BasedOn="{StaticResource HugeInputTextBoxStyle}">
		<Setter Property="FontSize" Value="{StaticResource infoTextSize}"/>
	</Style>
	
	<Style x:Key="DatePickerStyle" TargetType="{x:Type DatePicker}">
		<Setter Property="Background" Value="{StaticResource itemBackgroundBrush}"/>
		<Setter Property="BorderBrush" Value="{StaticResource borderBrush}"/>
		<Setter Property="BorderThickness" Value="2"/>
		<Setter Property="FontSize" Value="{StaticResource infoTextSize}"/>
		<Style.Triggers>
			<Trigger Property="Validation.HasError" Value="True">
				<Setter Property="BorderBrush" Value="Red"/>
				<Setter Property="ToolTip" Value="{Binding RelativeSource={RelativeSource Self}, Path=(Validation.Errors)[0].ErrorContent}" />
			</Trigger>
		</Style.Triggers>
	</Style>
	
	<Style TargetType="{x:Type Border}" x:Key="BorderSectionStyle">
		<Style.Triggers>
			<Trigger Property="Panel.Background" Value="{x:Null}"/>
		</Style.Triggers>
		<Setter Property="BorderThickness" Value="{StaticResource borderThickness}"/>
		<Setter Property="Margin" Value="8"/>
		<Setter Property="CornerRadius" Value="{StaticResource borderCornerRadius}"/>
		<Setter Property="BorderBrush" Value="{StaticResource borderBrush}"/>
		<Setter Property="Padding" Value="{StaticResource borderPadding}"/>
	</Style>
	
	<Style x:Key="ImportantTextStyle" TargetType="{x:Type TextBlock}">
		<Setter Property="Foreground" Value="#FFF6F73F"/>
		<Setter Property="FontSize" Value="21.333"/>
		<Setter Property="FontWeight" Value="Bold"/>
		<Setter Property="FontFamily" Value="Calibri"/>
	</Style>
	
	
	
	

</ResourceDictionary>